// Copied and modified from SFML/Config.hpp shamelessly

#ifndef __CONFIG_H__
#define __CONFIG_H__

////////////////////////////////////////////////////////////
// Identify the operating system
////////////////////////////////////////////////////////////
#if defined(_WIN32) || defined(__WIN32__)

    // Windows
    #define METGINE_SYSTEM_WINDOWS
    #ifndef WIN32_LEAN_AND_MEAN
        #define WIN32_LEAN_AND_MEAN
    #endif
    #ifndef NOMINMAX
        #define NOMINMAX
    #endif

#elif defined(linux) || defined(__linux)

    // Linux
    #define METGINE_SYSTEM_LINUX

#elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh)

    // MacOS
    #define METGINE_SYSTEM_MACOS

#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)  || defined(__gnu_hurd__)

    // FreeBSD
    #define METGINE_SYSTEM_FREEBSD

#else

    // Unsupported system
    #error This operating system is not supported by Metgine

#endif

////////////////////////////////////////////////////////////
// Define portable import / export macros
////////////////////////////////////////////////////////////
#if defined(METGINE_SYSTEM_WINDOWS)

    #ifdef METGINE_DYNAMIC

        // Windows platforms
        #ifdef METGINE_EXPORTS

            // From DLL side, we must export
            #define METGINE_API __declspec(dllexport)

        #else

            // From client application side, we must import
            #define METGINE_API __declspec(dllimport)

        #endif

        // For Visual C++ compilers, we also need to turn off this annoying C4251 warning.
        // You can read lots ot different things about it, but the point is the code will
        // just work fine, and so the simplest way to get rid of this warning is to disable it
        #ifdef _MSC_VER

            #pragma warning(disable : 4251)

        #endif

    #else

        // No specific directive needed for static build
        #define METGINE_API

    #endif

#else

    // Other platforms don't need to define anything
    #define METGINE_API

#endif

#define _T(x) (const char*)(x)

#define _STR(x) std::string(x)

#endif // __CONFIG_H__
